﻿Imports System.Reflection

''' <summary>
''' ダーティオブジェクト
''' </summary>
''' <remarks></remarks>
Public MustInherit Class DirtyObject

    ''' <summary>
    ''' ダーティタイプ
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public MustOverride ReadOnly Property DirtyType As DirtyTypes

    Private _key As String
    ''' <summary>
    ''' キー
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Key() As String
        Get
            Return _key
        End Get
        Protected Set(ByVal value As String)
            _key = value
        End Set
    End Property

    Private _instanceType As Type
    ''' <summary>
    ''' インスタンスの型
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property InstanceType As Type
        Get
            Return _instanceType
        End Get
        Protected Set(ByVal value As Type)
            _instanceType = value
        End Set
    End Property

    ''' <summary>
    ''' キープロパティリスト
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property KeyProperties As ICollection(Of LiteralProperty)
        Get
            Return Me.InstanceType.ToEntityDefinition.KeyProperties
        End Get
    End Property

    ''' <summary>
    ''' ダーティプロパティ
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public MustOverride ReadOnly Property DirtyProperties As IEnumerable(Of LiteralProperty)

End Class
